define(["jquery"], {
    baseUrl : "https://shopapi.smartisan.com/product/",
    homeData : function () {
        return new Promise((resolve) => {
            $.get(`${this.baseUrl}home`, resolve);
        })
    },
    secondNavData : function () {
        return new Promise((resolve) => {
            $.get("/lib/json/second-nav.json", resolve);
        })
    },
    hotWordsData : function () {
        return new Promise((resolve) => {
            $.get("/lib/json/hot-words.json", resolve);
        })
    },
    categoryData : function (url) {
        return new Promise((resolve) => {
            $.get(url, resolve);
        })
    },
    commendData : function () {
        return new Promise((resolve) => {
            $.get("https://shopapi.smartisan.com/product/skus?ids=100060201,100060202,100061001,100061001,100060901,100060401,100060601,100061101,100061201,100062701,100063401,100061801,100059001,100052801,100023501,100059808,100059726,100059315,100059401,100059901,100077702&with_stock=true&with_spu=true", resolve);
        })
    },
    itemData : function (id) {
        return new Promise((resolve) => {
            $.get(`https://shopapi.smartisan.com/product/skus?ids=${id}&with_stock=true&with_spu=true`, resolve);
        })
    }
})